/**
 * Created by g705353 on 10/30/2014.
 */

def greeting = 'Hello'

def cols = {param -> println("${greeting}, ${param}")}

cols.call('you')

greeting = 'haha ' // now change the value then result can be affected

cols.call('you')


def demo(col){
    def greeting = 'Bonjour'        //won't affect
    col.call('Kent')
}

//demo(cols)
demo cols

def index(){
    println("in method!")
}

index()
//println (index)  // error!


def c_index = {
    println("in closure!")
}

c_index()
println(c_index)  // is an instance of object

